package com.zhiliao.module.web.system.service;

import com.zhiliao.mybatis.model.TSysPermission;
import com.zhiliao.mybatis.model.TSysRole;
import com.zhiliao.mybatis.model.TSysRolePermission;

import java.util.List;

/**
 * Description:
 *
 * @author qirong
 * @date 2018-10-26
 */
public interface RoleService {

    /**
     * findByid
     * @param id
     * @return
     */
    TSysRole findByid(Integer id);

    /**
     * findByUserId
     * @param userId
     * @return
     */
    List<TSysRole> findByUserId(Integer userId);

    /**
     * delete
     * @param id
     * @return
     */
    String delete(Integer id);

    /**
     * update
     * @param role
     * @param permissionId
     * @return
     */
    String update(TSysRole role,Integer[] permissionId);

    /**
     * save
     * @param role
     * @param permissionId
     * @return
     */
    String save(TSysRole role,Integer[] permissionId);

    /**
     * findAll
     * @return
     */
    List<TSysRole> findAll();

    /**
     * findPermissonByPid
     * @param pid
     * @return
     */
    List<TSysPermission> findPermissonByPid(Integer pid);

    /**
     * findPermissionCountByRoleId
     * @param roleId
     * @param permissionId
     * @return
     */
    Integer findPermissionCountByRoleId(Integer roleId,Integer permissionId);

    /**
     * SaveRolePermission
     * @param rolePermission
     * @return
     */
    Integer  saveRolePermission(TSysRolePermission rolePermission);

    /**
     * findPermissonByid
     * @param pid
     * @return
     */
    TSysPermission findPermissonByid(Integer pid);

    /**
     * save
     * @param permission
     * @return
     */
    String save(TSysPermission permission);

    /**
     * update
     * @param permission
     * @return
     */
    String update(TSysPermission permission);

    /**
     * delectPermissionById
     * @param id
     * @return
     */
    String delectPermissionById(Integer id);

}
